package samfeng.erp.product.controller.admin.vo;

import cn.iocoder.yudao.framework.mybatis.core.type.ArrayStringTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import io.swagger.annotations.*;
import org.apache.ibatis.type.JdbcType;
import samfeng.erp.product.attribute.dal.dataobject.AttributeDO;
import samfeng.erp.product.specification.dal.dataobject.SpecificationDO;

import javax.validation.constraints.*;

/**
* 商品 Base VO，提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
*/
@Data
public class ProductBaseVO {

    @ApiModelProperty(value = "spu编码")
    private String spuCode;

    @ApiModelProperty(value = "spu名字", required = true)
    @NotNull(message = "名字不能为空")
    private String name;

    @ApiModelProperty(value = "卖点", required = true)
    //@NotNull(message = "卖点不能为空")
    private String sellPoint;

    @ApiModelProperty(value = "描述", required = true)
    //@NotNull(message = "描述不能为空")
    private String description;

    @ApiModelProperty(value = "最终分类ID")
    private Long lastCategoryId;

    @ApiModelProperty(value = "属性ID")
    private Long attributeId;

    @ApiModelProperty(value = "参数ID")
    private Long specificationId;

    @ApiModelProperty(value = "商品图片", required = true)
    @TableField(typeHandler = ArrayStringTypeHandler.class, jdbcType= JdbcType.VARCHAR)
    //@NotNull(message = "商品图片不能为空")
    private String picUrls;

    @ApiModelProperty(value = "是否上架（1是 0否）", required = true)
    @NotNull(message = "是否上架（1是 0否）不能为空")
    private String status;

    @ApiModelProperty(value = "排序字段", required = true)
    //@NotNull(message = "排序字段不能为空")
    private Integer sort;

    @ApiModelProperty(value = "销售价格")
    private BigDecimal salesPrice;

    @ApiModelProperty(value = "市场价")
    private BigDecimal marketPrice;

    @ApiModelProperty(value = "成本价")
    private BigDecimal costPrice;

    @ApiModelProperty(value = "库存")
    private Double stock;

    @ApiModelProperty(value = "销量")
    private Double saleNum;

    @ApiModelProperty(value = "是否点餐类别产品")
    private String pos;

    /**
     * 属性object
     */
    @TableField(exist = false)
    private List<AttributeDO> attribute;

    /**
     * 参数object
     */
    @TableField(exist = false)
    private List<SpecificationDO> specification;

    /**
     * 产品类别的层级id数组，用于前端展示
     */
    @TableField(exist = false)
    private List<String> categoryId;


}
